package com.ruoyi.system.controller;

import com.ruoyi.common.security.annotation.PreAuthorize;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("mq")
public class SendController {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @PreAuthorize(hasPermi = "resource:mq:send")
    @PostMapping("send")
    public void demo(){
        rabbitTemplate.convertAndSend("fanoutExchanges","","hello word");
    }
}
